package cn.klaw.service.impl;

import com.unfbx.chatgpt.entity.chat.Message;
import cn.klaw.constant.MsgCode;
import cn.klaw.exception.DataException;
import cn.klaw.model.ai.AiFormModel;
import cn.klaw.service.OpenAiService;

import java.util.List;

/**
 * 未启用是空实现
 *
 *
 * @date 2024/10/15 17:00
 */
public class DisabledOpenAiServiceImpl implements OpenAiService {
    @Override
    public String completion(String prompt) {
        return throwError();
    }

    @Override
    public String completion(Message... messages) {
        return throwError();
    }

    @Override
    public String generatorModelStr(String businessName) {
        return throwError();
    }

    @Override
    public List<AiFormModel> generatorModelVO(String prompt) {
        return throwError();
    }

    public <T> T throwError(){
        throw new DataException(MsgCode.SYS180.get());
    }
}
